package com.hunray.rent.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.validation.constraints.NotNull;

@Entity
@Table(name="t_account")
public class Account implements Serializable{
	
	private static final long serialVersionUID = 1L;

	private Integer id;
	
	private String no;
	
	private Double balance;
	
	@Id
	@GeneratedValue(strategy=GenerationType.TABLE,generator="tg_account")
	@TableGenerator(name="tg_account",table="t_id",pkColumnName="f_table",pkColumnValue="t_account",valueColumnName="f_id",initialValue=1,allocationSize=1)
	@Column(name="f_id")
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}
	@Column(name="f_no",nullable=false,unique=true)
	@NotNull
	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}
	@Column(name="f_balance")
	public Double getBalance() {
		return balance;
	}

	public void setBalance(Double balance) {
		this.balance = balance;
	}
	
	
	
}
